<?php
$ch = curl_init();
$curl_options = array (
//	CURLOPT_URL				=> "http://localhost/chingatown-mobile/enchingatown-mobile/src/lib/enchingatown.html",
	CURLOPT_URL				=> "http://enchingatown.com",
	CURLOPT_HTTP_VERSION	=> CURL_HTTP_VERSION_1_1,
	CURLOPT_VERBOSE			=> true,
	CURLOPT_SSL_VERIFYPEER	=> false,
	CURLOPT_SSL_VERIFYHOST	=> false,
	CURLOPT_FOLLOWLOCATION	=> true,
//	CURLOPT_PROXY			=> "localhost:8080",
	CURLOPT_RETURNTRANSFER	=> true
);
curl_setopt_array($ch, $curl_options);
$result = curl_exec($ch);
curl_close($ch);

//$search_start = '<div id="badgeSelection">';
//$search_end = '</ul>';
$search_start = '<body>';
$search_end = '</body>';
$start = strpos($result, $search_start) + strlen($search_start);
$end = strpos($result, $search_end, $start) + strlen($search_end) - $start;
$list = substr($result, $start, $end);

header("Content-Type: text/plain");
echo utf8_encode($list);